﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;

namespace Logic
{
    public class DiscLogic
    {
        public int GetLength(Disk disk)
        {
            List<AbstractTrack> tracks = disk.Tracks;
            int totalLength = 0;
            if (tracks != null)
            {
                for (int i = 0; i < tracks.Count; i++)
                {
                    AbstractTrack track = tracks[i];
                    totalLength = totalLength + track.Length;
                }
            }
            return totalLength;
         }            
    }
}
